From: kobarity Date: Thu, 20 Mar 2025 10:03:33 +0000 (+0900) Subject: Disable echo back instead of setting tty to raw in Inferior Python X-Git-Tag: archive/raspbian/1%30.2+1-2+rpi1^2~2^2~24^2~137 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=4dcd66abd570e09093e37c3d0e150fd76a15c95c;p=emacs.git Disable echo back instead of setting tty to raw in Inferior Python * lisp/progmodes/python.el (python-shell-setup-code): Change the Python setup code. (Bug#76943) (cherry picked from commit 4c5c20ddc2cdde570ccf54c4aa60644828ee213d) --- diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index f966190ea6d..e593ea93ff4 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -3528,11 +3528,13 @@ eventually provide a shell." (defconst python-shell-setup-code "\ try: - import tty + import termios except ImportError: pass else: - tty.setraw(0)" + attr = termios.tcgetattr(0) + attr[3] &= ~termios.ECHO + termios.tcsetattr(0, termios.TCSADRAIN, attr)" "Code used to setup the inferior Python processes.") (defconst python-shell-eval-setup-code